﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Info;

namespace ConstellationShow
{
    public class Mark
    {
        public static string keyvalue = "";  //[缺省]加密字串,识别正确访问码
        public static int downclassid = 0;   //资源分类ID，1、软件；2、游戏；3、主题
        public static int downinfoid = 0; //资源ID
        public static string channelkey = ""; //渠道
        public static string softvs = "1"; //软件版本
        public static string network = "mobile";  //网络接入方式
        //公共URL生成
        public static string MarkUrl(string url) {
            url += "phonename=" + DeviceExtendedProperties.GetValue("DeviceName").ToString();
            url += "&phonevsno=WindowsPhone";
            url += "&phonevs=" + DeviceExtendedProperties.GetValue("DeviceName").ToString();
            url += "&keyvalue=" + keyvalue;
            url += "&imei=" + MD5Helper.GetMd5String(BitConverter.ToString(
                    (byte[])DeviceExtendedProperties.GetValue("DeviceUniqueId")
                    )); ;
            url += "&downclassid=" + downclassid;
            url += "&downinfoid=" + downinfoid;
            url += "&channelkey=" + channelkey;
            url += "&softvs=" + softvs;
            url += "&network=" + network;
            return url;
        }
    }
}
